package october;

public class LongestIncreasingSubsequence {
    public static void main(String[] args) {
        int[] array = new int[]{4,2,6,1,3,8,5};
        int[] dp = new int[array.length];
        dp[0] = 1;
        for( int i = 1; i < array.length; i++ ) {
            dp[i] = 1;
            for( int j = 0; j < i; j++ ) {
                if( array[i] > array[j] ) {
                    if( dp[i] < dp[j]+1 ) {
                        dp[i] = dp[j]+1;
                    }
                }
            }
        }
        System.out.println();
    }
}
